<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Admin.Master" Inherits="System.Web.Mvc.ViewPage<TemplateWeb.Models.ViewModels.GroupViewModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    SelectSanPham
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent1" runat="server">
    <span class="AdminTitle" style="color: #cc0000;">SanPham Management</span> (<a href="<%= Url.Action("Index", "Home") %>"
        class="AdminPageText">
        <%= WebConfiguration.SiteName  %>
    </a>| <a href="<%= Url.Action("LogOff", "Account") %>" class="AdminPageText">LogOut
    </a>)
    <br />
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent2" runat="server">
    <script src="../../Scripts/fckeditor/fckeditor.js" type="text/javascript"></script>
    <script type="text/javascript">
        window.onload = function () {
            var objFckEditor = new FCKeditor('SanPham_MoTa');
            objFckEditor.BasePath = '<%= ResolveUrl("~/Scripts/fckeditor/")%>';
            objFckEditor.Height = 480;
            objFckEditor.Width = 600;
            objFckEditor.ToolbarSet = 'TemplateWeb.MyToolbar';
            objFckEditor.ReplaceTextarea();
        }
    </script>
    <script type="text/javascript">
		<% if (Model.SanPhamModel.InfoText != null && Model.SanPhamModel.InfoText != ""){ %>
			alert('<%= Model.SanPhamModel.InfoText %>');
		<% } %>
    </script>
    <div id="PartialDiv">
        <% Html.RenderPartial("Templates/TH_ListSanPham", Model); %>
    </div>
    <% using (Html.BeginForm("InsertSanPham", "Admin", FormMethod.Post, new { enctype = "multipart/form-data", onsubmit = "return ValidateSanPham();" }))
       { %>
    <input type="hidden" name="SanPham_IDDanhMucCon" value="<%= Model.SanPhamModel.ReferKeys.IDDanhMucCon %>" />
    <div style="padding-top: 40px">
        <span style="font-size: 18px; font-weight: bold;">Add New SanPham</span>
        <table width="100%" border="0" cellspacing="0" cellpadding="0" class="AdminPageText">
            <tbody>
                <tr>
                    <td>
                        <div align="left" style="padding-top: 15px">
                            <font class="normal8">TenSanPham: </font>
                        </div>
                    </td>
                    <td height="20">
                        <div align="left" style="padding-top: 15px">
                            <%= Html.TextBox("SanPham_TenSanPham", "", new { @style = "width: 590px;" })%>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td>
                        <div align="left" style="padding-top: 15px">
                            <font class="normal8">XuatXu: </font>
                        </div>
                    </td>
                    <td height="20">
                        <div align="left" style="padding-top: 15px">
                            <%= Html.TextBox("SanPham_XuatXu", "", new { @style = "width: 590px;" })%>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td>
                        <div align="left" style="padding-top: 15px">
                            <font class="normal8">ToChucCaNhan: </font>
                        </div>
                    </td>
                    <td height="20">
                        <div align="left" style="padding-top: 15px">
                            <%
                                var items = new List<SelectListItem>();
                                for (int i = 0; i < Model.ToChucCaNhanModel.GetModel.LstObjModel.Count; i++)
                                {
                                    items.Add(new SelectListItem
                                    {
                                        Text = Model.ToChucCaNhanModel.GetModel.LstObjModel[i].TenToChucCaNhan,
                                        Value = Model.ToChucCaNhanModel.GetModel.LstObjModel[i].ID.ToString()
                                    });
                                } %>
                            <%= Html.DropDownList("SanPham_IDToChucCaNhan", new SelectList(items, "Value", "Text"))%>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td>
                        <div align="left" style="padding-top: 15px">
                            <font class="normal8">MoTa: </font>
                        </div>
                    </td>
                    <td height="20">
                        <div align="left" style="padding-top: 15px">
                            <%= Html.TextArea("SanPham_MoTa")%>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td>
                        <div align="left" style="padding-top: 15px">
                            <font class="normal8">HinhAnh: </font>
                        </div>
                    </td>
                    <td height="20">
                        <div align="left" style="padding-top: 15px">
                            <input type="file" name="SanPham_HinhAnh" />
                        </div>
                    </td>
                </tr>
                <tr>
                    <td>
                        <div align="left" style="padding-top: 15px">
                            <font class="normal8">SoLuongTon: </font>
                        </div>
                    </td>
                    <td height="20">
                        <div align="left" style="padding-top: 15px">
                            <%= Html.TextBox("SanPham_SoLuongTon", "", new { @style = "width: 190px;" })%>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td height="20" style="width: 130px">
                    </td>
                    <td height="20">
                        <div align="left">
                            <br />
                            <p>
                                <input type="submit" value="Add New" />
                            </p>
                        </div>
                    </td>
                </tr>
            </tbody>
        </table>
    </div>
    <% } %>
</asp:Content>
